﻿import Router from 'vue-router'
import Index from '@/components/Index'
//index_main s
import Index_main from "@/components/index/index_main"
//index_main e
//发信 wrap
import Letter from '@/components/Letter/Letter'
//收信确认
import CertainLetter from "@/components/Letter/Certain_Letter"
//收信成功
import SucLetter from "@/components/Letter/Suc_Letter"

//登陆
import Login from "@/components/login/wrap_login"
const Register = r => require.ensure([], () => r(require('@/components/login/reginster.vue')));
const inner_login= r => require.ensure([], () => r(require('@/components/login/inner_login.vue')));
//Certain_layer
import Wrap_certain_layer from "@/components/Letter/layer_letter/wrap_certain_layer";
const Certain_layer = r => require.ensure([], () => r(require('@/components/Letter/layer_letter/Certain_layer.vue')));
const Certain_layer_input = r => require.ensure([], () => r(require('@/components/Letter/layer_letter/Certain_layer_input.vue')));

//Header_other
import Git_Exchange from "@/components/token/Gift_Exchange.vue"
//排信员也main
import Letter_man from "@/components/token/Letter_man.vue"
//礼物兑换
import Detail_Exchange from "@/components/token/Detail_Exchange.vue"
const my_Exchange = r => require.ensure([], () => r(require('@/components/token/My_Gift.vue')));
export default new Router({
  routes: [
    {
      path: '/',
      redirect:'/Login',
      meta: {
        //requireAuth: true,  // 添加该字段，表示进入这个路由是需要登录的
      },
      name: 'Index',
      component: Index,
      children: [
        {
          // 当 /user/:id/profile 匹配成功，
          // UserProfile 会被渲染在 User 的 <router-view> 中
          path: 'letter',
          component: Letter,
          redirect:'letter/SucLetter',
          children:[
            {
              path: 'CertainLetter',
              component: CertainLetter
            },
            {
              path: 'SucLetter',
              component: SucLetter
            },
          ]
        },
        {
          path:"Index_main",
          component:Index_main,
          //收信确认弹窗
          children:[
            {
              path:"Wrap_certain_layer",
              component:Wrap_certain_layer,
              children:[
                {
                  path:"Certain_layer",
                  component:Certain_layer
                },
                {
                  path:"Certain_layer_input",
                  component:Certain_layer_input
                }
              ]
            },
          ]
        },
        {
          path:"Git_Exchange",
          component: Git_Exchange,
        },
        {
            path: "my_Exchange",
            component: my_Exchange
        }
      ]
    },
    {
      path:"/Login",
      component:Login,
      redirect:'/Login/inner_login',
      //收信确认弹窗
      children:[
        {
          path:"Register",
          component:Register
        },
        {
          path:"inner_login",
          component:inner_login
        }
      ]
    },
    {
        path: "/Letter_man",
        component: Letter_man,
    }
  ]
})
